
quit -sim

set env(ALTERA_LIB)         altera18.0_questasim_10.6c_lib
set env(LIB_PATH)           F:/crack/
vmap   $env(ALTERA_LIB)     $env(LIB_PATH)$env(ALTERA_LIB)

#工程所需要的文件
vlog -sv -incr ../bench/top_tb.sv
vlog -incr ../hdl/top.v

#################nios文件###############

file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_bht_ram.dat ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ic_tag_ram.dat ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ociram_default_contents.dat ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_a.dat ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_b.dat ./

file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_bht_ram.hex ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ic_tag_ram.hex ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ociram_default_contents.hex ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_a.hex ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_b.hex ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_onchip_memory.hex ./

file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_bht_ram.mif ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ic_tag_ram.mif ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_ociram_default_contents.mif ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_a.mif ./
file copy -force ../fpga_project/output_files/nios_cpu/simulation/submodules/nios_cpu_cpu_cpu_rf_ram_b.mif ./

file copy -force ../qsys/software/basic/mem_init/hdl_sim/nios_cpu_onchip_memory.dat ./ 
file copy -force ../qsys/software/basic/mem_init/nios_cpu_onchip_memory.hex ./ 

vlog -incr      ../fpga_project/output_files/nios_cpu/simulation/nios_cpu.v
vlog -incr      ../fpga_project/output_files/nios_cpu/simulation/submodules/*.v
vlog -incr      ../fpga_project/output_files/nios_cpu/simulation/submodules/*.vo
vlog -sv -incr  ../fpga_project/output_files/nios_cpu/simulation/submodules/*.sv


vsim -t ps -voptargs="+acc" -L $env(ALTERA_LIB) work.top_tb

log -r /*
radix 16

do wave.do

run 3ms
